cmake_minimum_required(VERSION 3.22)
project(LiveGraph)

set(CMAKE_CXX_STANDARD 14)
message(CMAKE_PREFIX_PATH：${CMAKE_PREFIX_PATH})
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)


find_package(Qt5 COMPONENTS
        Core
        Gui
        Widgets
        Svg
        SerialPort
        REQUIRED)

find_package(glog REQUIRED)

message("find Qt5 at ${Qt5_DIR}")

message("QT5_INCLUDE_DIR: ${QT5_INCLUDE_DIR}")
if (WIN32)
    set(QT5_INCLUDE_DIR ${Qt5_DIR}/../../../include)
    find_path(QWT_INCLUDE_DIR NAMES qwt.h PATHS ${QT5_INCLUDE_DIR} PATH_SUFFIXES qwt)
    set(QT5_INCLUDE_DIR ${Qt5_DIR}/../../../include)
    find_library(QWT_LIBRARY NAMES libqwt.dll.a PATHS ${Qt5_DIR}/../../../lib)
else()
    find_library(QWT_LIBRARY NAMES libqwt.so PATHS /usr/lib /usr/local/lib)
endif()
message("find qwt.h at: ${QWT_INCLUDE_DIR} and qwt.lib at: ${QWT_LIBRARY}")
include_directories(${QWT_INCLUDE_DIR})


add_subdirectory(Src)
add_subdirectory(Test)

